<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
        xmlns:f="http://java.sun.com/jsf/core"
        xmlns:h="http://java.sun.com/jsf/html"
        xmlns:ui="http://java.sun.com/jsf/facelets"
        xmlns:t="http://myfaces.apache.org/tomahawk">
<!--
/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
//-->
<body>
 <ui:composition template="/META-INF/templates/template.xhtml">
   <ui:define name="body">
    <h:panelGroup id="idbody">
        <h:form id="selection">
                <h:selectOneMenu id="selone_menu_panel" value="#{stackState.selected}" styleClass="selectOneMenu" onchange="document.forms['selection'].submit();">
                    <f:selectItem itemValue="treePanel" itemLabel="#{example_messages['treePanel']}" />
                    <f:selectItem itemValue="selectBoxPanel" itemLabel="#{example_messages['selectBoxPanel']}" />
                </h:selectOneMenu>
        </h:form>

        <t:panelStack id="stack" selectedPanel="#{stackState.selected}">
          <h:panelGroup id="treePanel1">
              <h:form>
                  <t:tree id="tree" value="#{tree1Backer.treeModel}"
                      styleClass="tree"
                      nodeClass="treenode"
                      selectedNodeClass="treenodeSelected"
                      expandRoot="true">
                  </t:tree>
               </h:form>   
              <f:verbatim><br/></f:verbatim>
          </h:panelGroup>
          <h:panelGroup id="treePanel2">
              <h:form>
              <t:tree id="tree2" value="#{tree1Backer.treeModel}"
                      styleClass="tree"
                      nodeClass="treenode"
                      selectedNodeClass="treenodeSelected"
                      expandRoot="true">
              </t:tree>
              </h:form>
              <f:verbatim><br/></f:verbatim>
          </h:panelGroup>
          <h:panelGroup id="selectBoxPanel">
              <t:messages id="messageList" styleClass="error" showDetail="true" summaryFormat="{0} " />
              <h:form>
                  <h:panelGrid columns="2">
                      <h:outputLabel for="selone_lb" value="#{example_messages['label_cars']}" />
                      <h:selectOneListbox id="selone_lb" size="3" value="#{carconf.car}"
                                          validator="#{carconf.validateCar}" styleClass="selectOneListbox">
                          <f:selectItems id="selone_lb_cars" value="#{carconf.cars}" />
                      </h:selectOneListbox>
      
                      <h:outputLabel for="selone_menu_colors" value="#{example_messages['label_colors']}" />
                      <h:selectOneMenu id="selone_menu_colors" value="#{carconf.color}" styleClass="selectOneMenu" converter="#{carconf.colorConverter}">
                          <f:selectItem itemValue="" itemLabel="#{example_messages['empty_selitem']}" />
                          <f:selectItems value="#{carconf.colors}" />
                      </h:selectOneMenu>
      
                      <h:outputLabel for="selone_menu_extras" value="#{example_messages['label_extras']}" />
                      <h:selectManyCheckbox id="selone_menu_extras" value="#{carconf.extras}" layout="pageDirection" styleClass="selectManyCheckbox">
                          <f:selectItems value="#{carconf.extrasList}" />
                      </h:selectManyCheckbox>
      
                      <f:verbatim>&nbsp;</f:verbatim>
                      <h:panelGroup >
                          <h:selectOneRadio id="r1" value="#{carconf.discount}" layout="pageDirection"  styleClass="selectOneRadio">
                              <f:selectItem itemValue="1" itemLabel="#{example_messages['discount_0']}" />
                              <f:selectItem itemValue="2" itemLabel="#{example_messages['discount_1']}"  />
                              <f:selectItem itemValue="3" itemLabel="#{example_messages['discount_2']}"  />
                          </h:selectOneRadio>
                      </h:panelGroup>
      
                      <h:panelGroup ></h:panelGroup>
                      <h:panelGroup ></h:panelGroup>
      
                      <f:verbatim>&nbsp;</f:verbatim>
                      <h:panelGrid columns="1"  >
                          <!-- t:selectOneRadio is an extension of h:selectOneRadio
                                 if layout="spread" selectitems wont get rendered
                                 instead t:radio components are getting rendered
                          -->
                          <t:selectOneRadio id="discount2" value="#{carconf.discount2}" layout="spread" styleClass="selectOneRadio">
                              <f:selectItem itemValue="0" itemLabel="#{example_messages['discount_2_0']}" />
                              <f:selectItem itemValue="1" itemLabel="#{example_messages['discount_2_1']}" />
                              <f:selectItem itemValue="2" itemLabel="#{example_messages['discount_2_2']}" />
                          </t:selectOneRadio>
                          <h:panelGroup>
                              <t:radio for="discount2" index="2" /><f:verbatim>&nbsp;</f:verbatim>
                              <h:inputText value="#{carconf.bandName}" />
                          </h:panelGroup>
                          <!-- t:radio is a myfaces extension. renders the selectItem at the
                               given index (starting with 0). the for attribute must be the id
                               of the corresponding t:selectOneRadio -->
                          <t:radio for="discount2" index="0" />
                          <t:radio for="discount2" index="1" />
      
                      </h:panelGrid>
      
                      <h:outputLabel for="doors" value="#{example_messages['doors']}" />
                      <h:selectOneMenu id="doors" value="#{carconf.doors}">
                              <f:selectItem itemValue="#{2}" itemLabel="2" />
                              <f:selectItem itemValue="#{4}" itemLabel="4" />
                              <f:selectItem itemValue="#{7}" itemLabel="7" />
                      </h:selectOneMenu>
      
                      <h:outputLabel for="selboolean" value="#{example_messages['sales_tax']}" />
                      <h:selectBooleanCheckbox id="selboolean" value="#{carconf.salesTax}"/>
      
                      <f:verbatim>&nbsp;</f:verbatim>
                      <h:commandButton action="#{carconf.calcPrice}" value="#{example_messages['button_calcprice']}" />
      
                  </h:panelGrid>
              </h:form>
      
              <h:outputFormat value="#{example_messages['msg_price']}" >
                  <f:param value="#{carconf.price}" />
              </h:outputFormat>
      
          </h:panelGroup>
        </t:panelStack>

    </h:panelGroup>   
   </ui:define>
 </ui:composition>
</body>
</html>